#include<stdio.h>
int main()
{
	int m,n,i;
	int i1,i2,i3;
	scanf("%d%d",&m,&n);
	if(m>n)
	{
		int x;
		x=m;
		m=n;
		n=x;
	}
	for(i=m;i<=n;i++)
	{
		i1=i%10;
		i2=i/10%10;
		i3=i/100%10;
		if(i==(i1*i1*i1+i2*i2*i2+i3*i3*i3))
		{
			printf("%d ",i);
		}
	}
	return 0;
} 
